-
Notifications
You must be signed in to change notification settings - Fork 32
Enable internal rustc lints
#316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It has too many false-positives to be useful, unfortunately.
|
@BD103 Are you sure we want to enable |
Actually, no, I didn't see that conversation before. I think some lints may still be useful, but maybe it would be good to avoid enabling the entire If you look at the list of lints, which ones do you think are most useful for us? |
Hmm, good question. I'm fine with just enabling all and seeing how it feels? Otherwise, these sound most useful to me:
|
I think I'm fine with this as well. We'll experiment with them all on (except (Also that link on incremental compilation was really cool!) |
|
|
||
| #[allow( | ||
| rustc::potential_query_instability, | ||
| reason = "Iterating a hash map may lead to query instability, but the fix is not trivial." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we swap to a BTreeMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! I didn't even think of that! I switched it over to BTreeMap. Looks like rustc_data_structures has SortedMap<K, V>, which may be better, but I'll stick to BTreeMap for now.
DaAlbrecht
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What an interesting issue this has been! Learned a lot :)
Turns out our
#![warn(rustc::internal)]wasn't doing anything, since-Z unstable-optionswasn't being passed to the compiler. This PR enables the internalrustclints in CI, and leaves a comment so people know how to enable it themselves.With the lint group now enabled, this PR also fixes any leftover warnings. The biggest note right now is that we iterate over a hash map in some places, even though that iteration is not deterministic. There was one spot that I temporarily
#[allow(...)]d, even though it wasn't deterministic, since it seemed to complicated to fix right now.